USE [notarial]
GO

/****** Object:  Table [dbo].[NotarialFormRange]    Script Date: 10/28/2011 16:47:11 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[NotarialFormRange](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nchar](500) NOT NULL,
	[StartNumber] [bigint] NOT NULL,
	[EndNumber] [bigint] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[SerialNumberId] [int] NOT NULL,
 CONSTRAINT [PK_NotarialFormNumberRange] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[NotarialFormRange]  WITH CHECK ADD  CONSTRAINT [FK_NotarialFormRange_NotarialFormSerialNumber] FOREIGN KEY([SerialNumberId])
REFERENCES [dbo].[NotarialFormSerialNumber] ([Id])
GO

ALTER TABLE [dbo].[NotarialFormRange] CHECK CONSTRAINT [FK_NotarialFormRange_NotarialFormSerialNumber]
GO

ALTER TABLE [dbo].[NotarialFormRange] ADD  CONSTRAINT [DF_NotarialFormRange_CreateDate]  DEFAULT (getdate()) FOR [CreateDate]
GO

ALTER TABLE [dbo].[NotarialFormRange] ADD  CONSTRAINT [DF_NotarialFormRange_SerialNumberId]  DEFAULT ((1)) FOR [SerialNumberId]
GO


